function SetCategoryClick( id ){

	
	var str_id = id.replace( "_ul", "" );
	
	$( "#"+str_id ).toggle(function(){
			
		$("#"+id).addClass("expanded"); 

	},function(){
		$("#"+id).removeClass("expanded"); 

	});   

}

$(document).ready(function(){


	//category click show/hide
	$( "#allcatelist" ).find("ul").each(
		function() {
			SetCategoryClick( this.id );
		}
	);

});


$(document).ready(function(){
	$(".mall_item img").each(function(){
		var width = 130;
		var image = $(this);
		
	    if(image.width()>width){
	
	     image.width(width);
	     image.height(width/image.width()*image.height());
	    }   
	});
});	


$(window).load(function() {

	$(".hot_shop_index img, .rencent_reviews img").each(function() {
	
	 if((typeof this.naturalWidth != "undefined" && this.naturalWidth == 0 ) || this.readyState == 'uninitialized' ){
			
	//if (!this.complete || (!$.browser.msie && typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) ){
		
			this.src = edp_static_domain_url+'image/defaultpicture80.gif';
	}});
	
	$(".hot_product img").each(function() {

		if((typeof this.naturalWidth != "undefined" && this.naturalWidth == 0 ) || this.readyState == 'uninitialized' ){
	
		this.src = edp_static_domain_url+'image/nopicture80.gif';
	}});
});
